package com.tedu.spring.boot.demo1.controller;

import com.tedu.spring.boot.demo1.common.JSONResult;
import com.tedu.spring.boot.demo1.entity.vo.WeiboVO;
import com.tedu.spring.boot.demo1.service.WeiboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Author：毕龙
 * Date: 2024/8/29 15:21
 */
@RestController
@CrossOrigin
@RequestMapping("/v1/weibo/")
public class WeiboController {

    @Autowired
    private WeiboService weiboService;

    @GetMapping("/list")
    public JSONResult list(){
        List<WeiboVO> vos = weiboService.listWeibo();
        return JSONResult.ok(vos);
    }

}
